home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
msqc25t1
/
child.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-09-04
|
683b
|
33 lines
/* child.c: Chile process
This program is invoked by a apawn..() or exec...()
call. List arguments passed and the enviroment
strings COMSPEC, PROMPT, PATH, and XYZ
*/
#include <stdlib.h>
#include <stdio.h>
void main (int argc, char *argv[])
{
int n;
char *estr, *var[] = {"COMSPEC", "PROMPT", "PATH", "XYZ"};
puts ("\n\nIn child process, arguments are:");
for (n = 0; n < argc; n++)
printf (" argv [%d] = %s", n, argv [n]);
puts ("\n\nChild's environmental strings are:");
for (n = 0; n < 4; n++) {
estr = getenv (var [n]);
printf (" %s = %s\n", var [n],
estr == NULL ? "(nonexistent)" : estr);
}
exit (EXIT_SUCCESS);
}